Skip to content

Split arm-resource-operation lint rule into three focused rules#4808

Draft
catalinaperalta with Copilot wants to merge 2 commits into
mainfrom
copilot/update-arm-resource-operation-rules
Draft

Split arm-resource-operation lint rule into three focused rules#4808
catalinaperalta with Copilot wants to merge 2 commits into
mainfrom
copilot/update-arm-resource-operation-rules

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The single arm-resource-operation rule was covering three unrelated checks with mixed concerns, making it hard to suppress selectively or tune severity independently.

Rule split

Rule Check
arm-resource-operation (narrowed) Operation must be inside an interface declaration
arm-resource-operation-missing-decorator (new) Operation must use the correct ARM decorator for its HTTP verb (@armResourceRead, @armResourceCreateOrUpdate, etc.)
arm-resource-operation-missing-api-version (new) Operation must include Azure.ResourceManager.CommonTypes.ApiVersionParameter — more specific than the typespec-azure-core equivalent which accepts any apiVersion string parameter

Both new rules are enabled in the resource-manager ruleset. All existing test coverage is preserved and split into per-rule test files.

Example: decorator check

@armResourceOperations
interface FooResources {
  // ❌ arm-resource-operation-missing-decorator
  @put createOrUpdate(...ResourceInstanceParameters<FooResource>, @bodyRoot resource: FooResource): ArmResponse<FooResource>;

  // ✅
  createOrUpdate is ArmResourceCreateOrReplaceAsync<FooResource>;
}

…issing-decorator and arm-resource-operation-missing-api-version

Co-authored-by: catalinaperalta <9859037+catalinaperalta@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates linter Issues related to linter rules labels Jul 2, 2026
Copilot AI changed the title [WIP] Update @azure-tools/typespec-azure-resource-manager to split rules Split arm-resource-operation lint rule into three focused rules Jul 2, 2026
Copilot AI requested a review from catalinaperalta July 2, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library linter Issues related to linter rules meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[resource-manager]: Update @azure-tools/typespec-azure-resource-manager/arm-resource-operation to split rules

2 participants